<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/font-awesome/4.7.0/css/font-awesome.min.css">
    <style>
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        a {
            text-decoration-line: none;
        }

        body {
            background-color: #f5f5f5; /* Light Gray */
            font-family: Arial, sans-serif;
        }

        .title {
            font-size: 24px;
            font-weight: bold;
            text-align: center;
            margin: 20px 0;
            color: #e25822; /* Tangerine color */
        }

        .section-list {
            list-style: none;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .section-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 80%;
            margin: 10px;
            padding: 15px;
            border: 1px solid #ccc;
            background-color: #fff; /* White */
            border-radius: 8px;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }

        .section-item:hover {
            background-color: #f0f0f0; /* Lighter Gray on Hover */
        }

        .section-text {
            font-size: 18px;
            color: #333; /* Dark Gray */
        }

        .section-icon {
            width: 30px;
            height: 30px;
            background-repeat: no-repeat;
        }

        .bottom-nav {
            background-color: #333;
            position: fixed;
            bottom: 0;
            width: 100%;
            display: flex;
            justify-content: space-around;
            align-items: center;
        }

        .bottom-nav a {
            display: block;
            color: #f2f2f2;
            text-align: center;
            padding: 14px 0;
            font-size: 17px;
            flex: 1;
        }

        .bottom-nav i {
            margin-right: 4px;
        }

        .bottom-nav a:hover {
            background-color: #4caf50; /* Green */
            color: white;
        }

        .bottom-nav a.active {
            background-color: #4caf50; /* Green */
            color: white;
        }
        .fa-star1{
            background-image: url("images/shou.png");
        }

        .fa-commenting1{
            background-image: url("./images/about.png");
        }
        .fa-refresh1{
            background-image: url("./images/update.png");
        }
        .fa-envelope1{
            background-image: url("./images/idea.png");
        }
        .fa-yinsi{
            background-image: url("./images/yinsi.png");
        }
        .menu-icon {
            position: fixed;
            top: 20px;
            right: 20px;
            font-size: 24px;
            cursor: pointer;
        }

        .dropdown-menu {
            display: none;
            position: fixed;
            top: 60px;
            right: 20px;
            background-color: #fff;
            border: 1px solid #ccc;
            border-radius: 8px;
            padding: 10px;
            z-index: 1000;
        }

        .dropdown-item {
            cursor: pointer;
            padding: 8px;
        }

        .dropdown-item:hover {
            background-color: #f0f0f0;
        }
    </style>
</head>
<body>
<div class="menu-icon" onclick="toggleDropdown()">
    <i class="fa fa-bars"></i>
</div>

<div class="dropdown-menu" id="dropdownMenu">
    <div class="dropdown-item" onclick="logout()">Logout</div>
    <div class="dropdown-item" onclick="changePassword()">Alterar senha</div>
</div>
<div class="title">Centro Pessoal</div>
<ul class="section-list">
    <li class="section-item" onclick="navigateTo('idea.html')">
        <span class="section-text">feedback</span>
        <i class="section-icon fa fa-envelope1"></i>
    </li>
    <li class="section-item" onclick="navigateToByJava('https://www.artistcg.top')">
        <span class="section-text">atualizar</span>
        <i class="section-icon fa fa-refresh1"></i>
    </li>
    <li class="section-item" onclick="navigateTo('function.html')">
        <span class="section-text">sobre</span>
        <i class="section-icon fa fa-commenting1"></i>
    </li>
    <li class="section-item" onclick="navigateToByJava('https://www.artistcg.top/agreement/pt/br/privacy.html')">
        <span class="section-text">Acordo de Privacidade</span>
        <i class="section-icon fa fa-yinsi"></i>
    </li>
    <!-- Display only the favorite questions -->
    <li class="section-item" id="favorite-section" onclick="navigateTo('favorite.html')">
        <span class="section-text">Títulos favoritos</span>
        <i class="section-icon fa fa-star1"></i>
    </li>
</ul>
<div class="bottom-nav">
    <a href="index.html" onclick="setActiveNav(this)"><i class="fa fa-home"></i>página inicial</a>
    <a href="question.html" onclick="setActiveNav(this)"><i class="fa fa-align-justify"></i>teste</a>
    <a href="mine.html" class="active" onclick="setActiveNav(this)"><i class="fa fa-user"></i>Centro Pessoal</a>
</div>

<script>
    var dropdownMenu = document.getElementById('dropdownMenu');

    function toggleDropdown() {
        dropdownMenu.style.display = (dropdownMenu.style.display === 'block') ? 'none' : 'block';
    }

    function logout() {
        // 在这里执行退出登录逻辑
        console.log('Logout');

        localStorage.removeItem('token');
        localStorage.removeItem('username');
        localStorage.removeItem('expirationTime');
        window.location.href="main.html"
    }

    function changePassword() {
        // 在这里执行修改密码逻辑
        console.log('Change Password');
        window.location.href="change-password.html"
    }
</script>

<script>
    function navigateTo(page) {
        // 在这里，你可以使用适当的导航逻辑，例如跳转到相应的页面
        window.location.href = page;
        console.log('Navigating to ' + page);
    }

    // JavaScript 函数，用于根据传入的参数进行导航
    function navigateToByJava(page) {
        // 在这里，你可以使用适当的导航逻辑，例如跳转到相应的页面
        // window.location.href = page;
        Android.changeToView(page);
        console.log('Navigating to ' + page);
    }

    // JavaScript 函数，用于切换底部导航按钮的活动状态
    function setActiveNav(element) {
        // 移除所有导航按钮的活动状态
        var navButtons = document.querySelectorAll('.bottom-nav a');
        navButtons.forEach(function (navButton) {
            navButton.classList.remove('active');
        });

        // 添加当前点击导航按钮的活动状态
        element.classList.add('active');
    }
</script>
</body>
</html>